<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>优惠券管理</title>
	<meta name="decorator" content="default"/>
<link href="${ctxStatic}/jquery-ui-1.12.1/jquery-ui.min.css" rel="stylesheet" />
<script src="${ctxStatic}/jquery-ui-1.12.1/jquery-ui.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/js/messages_zh.js" type="text/javascript"></script>
<script src="${ctxStatic}/js/jquery.validate.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	
	
/*表单验证*/
$('#inputForm').validate({
    rules:{
     cpName:"required",
     dateFrom: "required",
     dateOver: "required",
     carPrice: "required",
     peoplePrice: "required",
     minNum:"required",
     ticket:"required"
    },	    
   messages:{
	   cpName: "请输入活动名称",
	   dateFrom:"请选择活动开始日期",
	   dateOver:"请选择活动结束日期",
	   carPrice: "请输入包车价格，无则填0",
	   peoplePrice: "请输入每人价格，无则填0",
	   minNum:"请输入最低参与人数",
	   ticket:"请输入门票价格"
   }
   
});		

});
</script>

</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/activity/tActivity/list">活动列表</a></li>
		<li class="active"><a href="javascript:">活动编辑</a></li>
	</ul>
	<form:form id="inputForm" modelAttribute="activityInfo"
		action="${ctx}/activity/tActivity/save" method="post" class="form-horizontal">
		<div class="control-group">
			<label class="control-label">活动名称：</label>
			<div class="controls">
				<form:input path="cpName" htmlEscape="false" maxlength="40"
						class="span4 required" name="cpName" />
			</div>
		</div>
		<input type="hidden" name="activityId" value="${activityInfo.activityId}">
		<div class="control-group" >
			<label class="control-label">活动开始时间：</label>
			<div class="controls">
				<input name="dateFrom"  type="text" readonly="readonly" 
					class="span4 Wdate"
					value="<fmt:formatDate value="${activityInfo.dateFrom}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
			</div>
		</div>
		<div class="control-group" >
			<label class="control-label">活动结束时间：</label>
			<div class="controls">
				<input name="dateOver"  type="text" readonly="readonly" 
					class="span4 Wdate"
					value="<fmt:formatDate value="${activityInfo.dateOver}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">包车价格：</label>
			<div class="controls">
				<form:input path="carPrice" htmlEscape="false" maxlength="20"
						class="span4 required" name="carPrice" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">每人价格：</label>
			<div class="controls">
				<form:input path="peoplePrice" htmlEscape="false" maxlength="20"
						class="span4 required" name="peoplePrice" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">最低参与人数：</label>
			<div class="controls">
				<form:input path="minNum" htmlEscape="false" maxlength="20"
						class="span4 required" name="minNum"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">门票价格：</label>
			<div class="controls">
				<form:input path="ticket" htmlEscape="false" maxlength="20"
						class="span4 required" name="ticket"/>
			</div>
		</div>
		
		<div class="form-actions">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="保 存" />&nbsp;
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />
		</div>
	</form:form>	
</body>
</html>